<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>第十四课 享元模式</title>
</head>

<body>
    <script>
        function SetNumText(type,num){
            this.div = null;
            this.type = type;
            this.num = num;
        }
        SetNumText.prototype.init = function(){
            this.div = document.createElement('div');
            this.div.innerHTML = this.type + this.num;
            document.body.appendChild(this.div);
        }

        for(var i=0;i<30;i++){
            var sz = new SetNumText('星星课堂',i + 100);
            sz.init();
        }

        for(var i=0;i<50;i++){
            var sy = new SetNumText('xingxingclassroom',i + 300);
            sy.init();
        }

    </script>
</body>

</html>